import 'dart:isolate';

import 'package:flutter_track/base/tracker_message_bean.dart';

abstract class BaseIsolateTracker {
  /// handleMainMessage，任务发送到了main isolate中，需要进行处理
  /// trackerSendport， 与子 isolate 进行通讯使用的端口
  void initTracker({
    required Function({
      required ActionMessage message,
      SendPort? trackerSendPort,
    })
        handleMainMessage,
  });

  void doTrack(int? baseIsolateInstructions, int? baseVm);

  void closeTracker();
}

abstract class BaseTrackChannel {
  void initTrackChannel();

  void doTrackByChannel();

  Future<String> getMessageByChannel() async {
    return "";
  }

  void releaseTrackChannel();
}
